home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / dep309.zip / DEPARC.EXE / SCRIPTS.EXE / BATBALL.DSL < prev    next >
Text File  |  1992-09-07  |  2KB  |  69 lines

  1. Script BatBall;     (* Bat & Ball Script V.1.00 by Michael Spalter *)
  2. VAR
  3. xpos : INTEGER;  ypos : INTEGER;
  4. xinc : INTEGER;  yinc : INTEGER;
  5. Col  : INTEGER;  Bat  : STRING[12];
  6. BatP : INTEGER;  Key  : INTEGER;       
  7. OldX : INTEGER;  OldY : INTEGER;
  8. Score : INTEGER; work : INTEGER;
  9. Dead : BOOLEAN;
  10.  
  11. BEGIN
  12.  
  13. (* Draw main screen *)
  14.  
  15. BackGnd(Black);
  16. ClrScr;
  17. GotoXY(1,1); BackGnd(Black); ForeGnd(Lgreen);
  18. Write("░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
  19. Write("░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
  20.    FOR Col:=1 TO 22 DO
  21.    GotoXY(1,Col); Write("░"); GotoXY(78,Col); Write("░");
  22.    END;
  23. ForeGnd(Yellow);
  24. GotoXY(2,0); Write(" Bat & Ball !    SCORE: 0000 ");
  25.  
  26. (* Set intital values of variables *)
  27.  
  28. Xpos:=5;  YPos:=8; Xinc:=1;  Yinc:=-1;
  29. Col:=13;  BatP:=38; Bat:='   ▀▀▀▀▀▀   ';
  30. Score:=0; Dead:=FALSE;  Cursor(False);
  31.  
  32. REPEAT
  33. GotoXY(OldX,OldY); Write("  ");
  34. INC(Xpos,Xinc);
  35. INC(YPos,Yinc);
  36.  
  37. REPEAT Key:=RdKey; UNTIL NOT KEYPRESSED;
  38.  
  39. IF Key=331 THEN DEC(BatP,3); END;
  40. IF Key=333 THEN INC(BatP,3); END;
  41. IF BatP<0 THEN Batp:=0; END;
  42. IF BatP>68 THEN Batp:=68; END;
  43.   
  44. GotoXY(OldX,OldY); Write("  ");
  45.  
  46. GotoXY(BatP,23); ForeGnd(LCyan); Write(Bat);
  47. IF Xpos>75 THEN Xinc:=-((ScriptTime MOD 2)+1); Alarm(1); END;
  48. IF Xpos<3  THEN Xinc:=1; Alarm(1); END;
  49. IF Ypos=2 THEN Yinc:=1; Alarm(1); END;
  50. ForeGnd(Yellow);
  51. IF Ypos=22 THEN 
  52.   IF (BatP<Xpos) AND (Xpos<(BatP+9)) THEN 
  53.   Yinc:=-1; INC(Score); Alarm(1);
  54.   GotoXY(26,0); Write(Score*1000); 
  55.   ELSE Dead:=TRUE;
  56.   END;
  57. END;
  58.  
  59. ForeGnd(Col); BackGnd(Black);
  60. GotoXY(XPos,YPos); Write('██'); 
  61. OldX:=Xpos; OldY:=Ypos;
  62. TDelay(2); 
  63. UNTIL Dead;
  64. Alarm(4);
  65. GotoXY(25,12); WrLn(' YOU ARE DEAD !!!!!! SCORE: ',Score*1000);
  66. Cursor(TRUE);
  67.  
  68. END BatBall.
  69.